#include "SIMS.h"

char* filename_admin_info = "D:/Code/vsCode/SIMS/resource/admin.txt";
char* filename_stu_info = "D:/Code/vsCode/SIMS/resource/stuInfo.txt";

void test() {
    LoadAdmin(filename_admin_info);
    Login();
    InitTable();

    int choice = 0;
    do {
        menu();
#ifdef ENGLISH
        printf("please input your choice: ");
#else
        printf("请输入你的选择: ");
#endif
        scanf("%d", &choice);
        switch (choice) {
            case ADD_STU_INFO:
                AddStuInfo();
                break;
            case DEL_STU_INFO:
                DeleteStuInfo();
                break;
            case FIND_STU_INFO:
                FindStuInfo();
                break;
            case SHOW_STU_INFO:
                ShowStuInfo();
                break;
            case MODIFY_STU_INFO:
                ModifyStuInfo();
                break;
            case SORT_STU_INFO:
                SortStuInfo();
                break;
            case EXIT_SYSTEM:
                SaveInfo();
#ifdef ENGLISH
                printf("exit system...\n");
#else
                printf("退出系统。。。\n");
#endif
                break;
            default:
#ifdef ENGLISH
                printf("invalid choice, please input again\n");
#else
                printf("无效选择，请重新输入\n");
#endif
                break;
        }
    } while (choice);
    // 释放资源
    FreeAll();
}

int main() {
    test();

    return 0;
}